package com.muyu.cloud.commodity.domain.resp;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.cloud.commodity.domain.model.SpecGroupListModel;
import lombok.Builder;
import lombok.Data;

import java.util.Date;

/**
 * @author <a href="mailto:602048165@qq.com">60204</a>
 * @version 1.0
 * @description:
 * @date 2025/9/15 20:33
 */
@Data
@Builder
public class SpecGroupListResp {
    private Long id;
    private String groupName;
    private Long categoryId;
    private Integer sort;
    private Integer status;
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date createdAt;
    private Integer valueCount;
    public static SpecGroupListResp listBuild(SpecGroupListModel m) {
        return SpecGroupListResp.builder()
                .id(m.getId())
                .groupName(m.getGroupName())
                .categoryId(m.getCategoryId())
                .sort(m.getSort())
                .status(m.getStatus())
                .createdAt(m.getCreatedAt())
                .valueCount(m.getValueCount())
                .build();
    }
}
